TreeViewCol: Fix SEGV on remove/add, + memory leak
authorDaniel Boles <dboles@src.gnome.org>
Fri, 6 Oct 2017 19:24:49 +0000 (20:24 +0100)
committerDaniel Boles <dboles.src@gmail.com>
Fri, 6 Oct 2017 23:46:37 +0000 (00:46 +0100)
commit497e877755f1fa165cdc8d14bf6b020d89c8ad2e
tree0cbc43e13c9a3b07aaa692f2dc6790a7c9f33d78
parentaf28c031fc15826053960c1b46d3df1837feb09a
TreeViewCol: Fix SEGV on remove/add, + memory leak

Nulling priv->button in _unset_tree_view() is asymmetrical: we create
it via init(), not _set_tree_view(), so we shouldn’t null in the latter.

Worse, doing so manifests in criticals + a SEGV easily with basic use of
testtreecolumns, removing the TVC from a TV then trying to add it to one

Finally, the wrong null-out meant dispose() failed to unref the button,
so it leaked.

https://bugzilla.gnome.org/show_bug.cgi?id=728452
https://bugzilla.gnome.org/show_bug.cgi?id=788614
gtk/gtktreeviewcolumn.c